<template>
	<view class="list">
		<view class="list-item" v-for="(item, index) in list" :key="item.id">
			<view class="left">
				<view class="title">
					<text :decode="true">{{ item.title }}</text>
				</view>
				<view class="info flex-box">
					<view class="progress">做题进度: {{ item.jindu }}%</view>
					<view class="zhunque">正确率:{{ item.zhunque }}%</view>
				</view>
			</view>
			<view class="right btn" @click="navTo(item)">
				 {{ item.actionText ? item.actionText : '去做题' }}
			</view>
		</view>
	</view>
</template>

<script>
export default {
	name: 'myListKs',
	props: {
		list: {
			type: Array,
			default: () => {
				return [];
			}
		}
	},
	data() {
		return {
			item: {}
		};
	},
	methods: {
		navTo(item) {
			// console.log(item);
			this.$emit('navTo', item);
		}
	}
};
</script>

<style lang="less" scoped>
@import '@/theme.less';
.list {
	.list-item {
		padding: 15rpx 0;
		display: flex;
		justify-content: space-between;
		align-items: center;
		margin-bottom: 20rpx;
		background-color: #fff;
		box-shadow: 0 0 4px rgba(0, 0, 0, 0.08);
		.left {
			flex: 1;
			margin-left: 32rpx;
			.title {
				font-size: 30rpx;
				color: #333;
				font-weight: 600;
				display: -webkit-box;
				-webkit-box-orient: vertical;
				-webkit-line-clamp: 2;
				overflow: hidden;
			}
			.info {
				margin-top: 20rpx;
				font-size: 24rpx;
				color: #999;
				justify-content: space-between;
			}
		}
		.right {
			margin-right: 32rpx;
			margin-left: 32rpx;
			width: 155rpx;
			height: 52rpx;
			border: 2rpx solid @themeColor;
			border-radius: 26rpx;
			line-height: 52rpx;
			font-size: 26rpx;
			text-align: center;
			color: @themeColor;
		}
	}
}
</style>
